<template>
  <div class="app-container">
    <!-- 侧边栏导航 -->
    <div class="sidebar">
      <h2>管理系统</h2>
      <router-link to="/index/booklist" class="nav-link">商品管理</router-link>
      <router-link to="/add-product" class="nav-link">用户管理</router-link>
      <router-link to="/edit-product" class="nav-link">编辑商品</router-link>
      <router-link to="/cart" class="nav-link">购物车</router-link>
    </div>
    <!-- 主内容区域 -->
    <div class="main-content">
      <h1 class="bookstore-title">蓝桥书城</h1>
      <!-- 路由视图，用于渲染不同的组件 -->
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: 'App'
};
</script>

<style scoped>
.app-container {
  display: flex;
  font-family: 'Roboto', sans-serif;
  background-color: #f8f8f8;
  min-height: 100vh;
}

.sidebar {
  background-color: #2c3e50;
  color: white;
  width: 220px;
  padding: 30px 20px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
  margin-bottom: 30px;
  font-size: 24px;
}

.nav-link {
  display: block;
  color: white;
  text-decoration: none;
  margin-bottom: 20px;
  font-size: 18px;
  padding: 10px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.nav-link:hover {
  background-color: #34495e;
  color: #ecf0f1;
}

.main-content {
  flex: 1;
  padding: 30px;
}

.bookstore-title {
  color: #333;
  font-size: 28px;
  margin-bottom: 30px;
}
</style>
